{extend name="base@:style" /}
{block name="body"}
<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="updateconfig">
                    <div class="layui-tab" lay-filter="check">
                        <ul class="layui-tab-title">
                            {volist name="Think.config.config_group_list" id="vo"}
                            <li {eq name="$vo['key']" value="$id"}class="layui-this" {/eq} lay-id="{$vo.key}"><a href="?id={$vo.key}">{$vo.value}配置</a></li>
                            {/volist}
                        </ul>

                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                {volist name="list" id="config" empty="暂无数据"}
                                <div class="layui-form-item">
                                    <label class="layui-form-label">{$config.title}</label>
                                    <div class="layui-input-block">
                                        {switch name="config.type"}
                                        {case value="1"}
                                        <input type="text" name="{$config.name}" required jq-verify="required" jq-error="{$config.mark}" placeholder="{$config.mark}" value="{$config.value}" autocomplete="off" class="layui-input ">
                                        {/case}
                                        {case value="2"}
                                        <textarea name="{$config.name}" placeholder="{$config.mark}" class="layui-textarea">{$config.value}</textarea>
                                        {/case}
                                        {case value="3"}
                                        <textarea name="{$config.name}" placeholder="{$config.mark}" class="layui-textarea">{$config.value}</textarea>
                                        {/case}
                                        {case value="4"}
                                        <input type="file" name="file" class="layui-upload-file">
                                        <!--<ul>-->
                                            <!--<li><img src="" alt=""></li>-->
                                        <!--</ul>-->
                                        <img id="LAY_upload" src="" style="display: block; max-height: 120px;max-width: 150px;margin-top: 20px">

                                        {/case}
                                        {/switch}
                                    </div>
                                </div>
                                {/volist}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" jq-submit jq-filter="submit" jq-tab="true">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<script>
    layui.use(['simpleform','upload'], function(){
        layui.upload({
            url: "{:url('system/file/upload_img')}" //统一上传接口
            ,success: function(res){ //上传成功后的回调
                LAY_upload.src = res.urls;
            }
        });

    });
</script>
{/block}